package com.byd.demo;

import org.springframework.web.bind.annotation.*;

/**
 * @author jinsuo.lin@definesys.com
 * @Description TODO
 * @Version 1.0.0
 * @Date 2023/3/12 17:07
 */
@RestController
@RequestMapping("/demo")
public class DemoController {

    private final DemoProducer demoProducer;

    public DemoController(DemoProducer demoProducer) {
        this.demoProducer = demoProducer;
    }


    @PostMapping("/msg/{tag}")
    public void sendMsg(@PathVariable("tag") String tag, @RequestBody DemoDto demoDto){
        demoProducer.sendMessage(tag,demoDto);
    }
}
